package com.liesheng.haylou.net;

import android.provider.ContactsContract;

import com.liesheng.haylou.base.BaseResult;
import com.liesheng.haylou.bean.GetInfoBean;
import com.liesheng.haylou.bean.LoginBean;
import com.liesheng.haylou.bean.NickNameBean;
import com.liesheng.haylou.bean.RegSmsCode;
import com.liesheng.haylou.bean.RegisterBean;
import com.liesheng.haylou.bean.ResetPswBean;
import com.liesheng.haylou.bean.UpdatePswBean;
import com.liesheng.haylou.bean.UploaddBean;
import com.liesheng.haylou.bean.UserUpdateBean;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Date:2019/11/6
 * <p>
 * Author:wuzhiguang
 * <p>
 * Description:
 */
public interface HttpService {
    /**
     * 登录
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST(HttpUrl.LOGIN)
    Observable<LoginBean> login(@Body RequestBody body);

    /**
     * 注册
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST(HttpUrl.REGISTER)
    Observable<RegisterBean> register(@Body RequestBody body);

    /**
     * 短信验证
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @GET(HttpUrl.SMSCODE)
    Observable<RegSmsCode> getSmsCode(@Query("countryCode") String countryCode, @Query("userPhone")
            String userPhone, @Query("type") String type);

    /**
     * 获取token
     */
    @GET("user/info")
    Observable<UserUpdateBean> getUserInfo();


    /**
     * 重置密码
     */
    @POST(HttpUrl.PASSWORDRESET)
    Observable<ResetPswBean> getResetPsw(@Body RequestBody body);

    /**
     * 头像上传
     */
    @POST(HttpUrl.UPDATEFILE)
    Observable<UploaddBean> getUploaddFile(@Body MultipartBody body);
    /**
     * 修改密码
     */
    @POST(HttpUrl.PASSWORDUPDATE)
    Observable<UpdatePswBean> getPasswordUpdate(@Body RequestBody body);

    /**
     * 修改用户信息
     * @param body
     * @return
     */
    @POST(HttpUrl.USERUPDATE)
    Observable<NickNameBean> getUserUpdate(@Body RequestBody body);
}
